package org.alex.samples.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name = "exam_subject")
public class Subject implements Serializable{
	

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column(name="sub_id",nullable=false)
	private Integer id;
	
	@Column(name="name",length=45,nullable=false)
	private String name;
	
	@Column(name="description",length=255,nullable=false)
	private String description;
	
	@Column(name="test_count",nullable=false)
	private Integer test_count;
	
	@Column(name="total_time",nullable=false)
	private Integer total_time;
	
	@Column(name="total_score",nullable=false)
	private double total_score;
	
	@Column(name="status",nullable=false)
	private Integer status;
	
	@OneToMany(mappedBy="subject", fetch=FetchType.EAGER)
	private Set<UserSubject> userSubject;
	
	@OneToMany(mappedBy="subject", fetch=FetchType.EAGER)
	private Set<ExamScore> examScore;

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getTest_count() {
		return this.test_count;
	}

	public void setTest_count(Integer test_count) {
		this.test_count = test_count;
	}

	public Integer getTotal_time() {
		return this.total_time;
	}

	public void setTotal_time(Integer total_time) {
		this.total_time = total_time;
	}

	public double getTotal_score() {
		return this.total_score;
	}

	public void setTotal_score(double total_score) {
		this.total_score = total_score;
	}

	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Set<UserSubject> getUserSubject() {
		return userSubject;
	}

	public void setUserSubject(Set<UserSubject> userSubject) {
		this.userSubject = userSubject;
	}

	public Set<ExamScore> getExamScore() {
		return examScore;
	}

	public void setExamScore(Set<ExamScore> examScore) {
		this.examScore = examScore;
	}
	
	
}